package cn.melon.window;

import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;

import cn.melon.view.admin.course.CourseJPanel;
import cn.melon.view.admin.dorm.DormJPanel;
import cn.melon.view.admin.library.LibraryJPanel;
import cn.melon.view.admin.roll.RollJPanel;
import cn.melon.view.admin.store.StoreJPanel;

public class AdminMainWindow {

    private JFrame frame;

    private JPanel rollPanel = new RollJPanel();
    private JPanel storePanel = new StoreJPanel();
    private JPanel courseJPanel = new CourseJPanel();
    private JPanel libraryJPanel = new LibraryJPanel();
    private JPanel dormJPanel = new DormJPanel();
    
    private JPanel mainPanel = new JPanel();
    JTabbedPane tab = new JTabbedPane();

    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
            public void run() {
                try {
                    AdminMainWindow window = new AdminMainWindow();
                    window.frame.setVisible(true);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
    }

    /**
     * Create the application.
     */
    public AdminMainWindow() {
        initialize();
    }

    public void setVisible(Boolean isVisible) {
        this.frame.setVisible(isVisible);
    }

    /**
     * Initialize the contents of the frame.
     */
    private void initialize() {
        frame = new JFrame();
        frame.setBounds(150, 150, 1250, 800);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setResizable(false);
        tab.add("学籍信息管理", rollPanel);
        tab.add("图书馆管理", libraryJPanel);
        tab.add("课程信息管理", courseJPanel);
        tab.add("商店信息管理", storePanel);
        tab.add("宿舍信息管理", dormJPanel);

        mainPanel.add(tab);
        frame.add(mainPanel);
    }

}
